import { useReactive } from "ahooks";
import { useModel } from "umi";
import { useEffect } from "react";
import compress from "gql-compress";

const useAllBrands = () => {
	const { graphqlFetch } = useModel("global");

	const state = useReactive({
		loading: false,
		brands: [],
	});

	const loadAllBrands = async () => {
		state.loading = true;
		state.brands = [{ ccName: "品牌名称1", ccdesc: "xxx品牌公司" }, { ccName: "品牌名称2", ccdesc: "xxx商贸公司" }, { ccName: "品牌名称3" }, { ccName: "品牌名称4" }];
		state.loading = false;
	};

	useEffect(() => {
		loadAllBrands();
	}, []);

	return { ...state, loadAllBrands };
};

let query = compress(``);

export default useAllBrands;
